<!DOCTYPE html>
<html>
<head>
  <title>ROS Node Manager</title>
  <script src="/static/script.js"></script>
</head>
<body>
  <h1>ROS Node Manager</h1>

  <!-- 选择二进制文件 -->
  <form id="nodeForm">
    <label>输入二进制文件路径: </label>
    <input type="text" id="fileInput" placeholder="/home/user/catkin_ws/devel/lib/demo_pkg/my_node"/>
    <button type="submit">启动节点</button>
  </form>
  <p id="nodeStatus"></p>

  <hr>
  <h2>话题管理</h2>
  <button onclick="loadTopics()">刷新话题</button>
  <ul id="topics"></ul>

  <h3>发布消息</h3>
  <form id="pubForm">
    <input type="text" id="topicName" placeholder="/topic_name" required>
    <input type="text" id="msg" placeholder="消息内容" required>
    <button type="submit">发布</button>
  </form>
  <p id="pubStatus"></p>

  <hr>
  <h3>订阅消息</h3>
  <input type="text" id="subTopic" placeholder="/topic_name">
  <button onclick="subscribeTopic()">订阅</button>
  <div id="subMessages"></div>
</body>
</html>